{% extends 'resume_manage/base_information.html' %}
{% load static %}

{% block content %}
    <div class="container">
        <h2>简历预览</h2>

        <div class="resume-preview">
            <!-- 基本信息部分 -->
            <div class="section">
                <h3 class="section-title"><i class="fas fa-id-card"></i> 基本信息</h3>
                {% if base_info %}
                    <div class="row">
                        <div class="col-md-6">
                            <p><strong>姓名：</strong> {{ base_info.name }}</p>
                            <p><strong>性别：</strong> {{ base_info.gender }}</p>
                            <p><strong>出生日期：</strong> {{ base_info.birthday }}</p>
                        </div>
                        <div class="col-md-6">
                            <p><strong>联系电话：</strong> {{ base_info.phone }}</p>
                            <p><strong>电子邮箱：</strong> {{ base_info.email }}</p>
                            <p><strong>所在地区：</strong> {{ base_info.location }}</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <p><strong>个人描述：</strong></p>
                            <p>{{ base_info.personal_description|default:'-' }}</p>
                        </div>
                    </div>
                {% else %}
                    <p class="text-muted">暂无基本信息</p>
                {% endif %}
            </div>

            <!-- 教育经历部分 -->
            <div class="section">
                <h3 class="section-title"><i class="fas fa-graduation-cap"></i> 教育经历</h3>
                {% if education %}
                    <div class="education-item">
                        <div class="row">
                            <div class="col-md-6">
                                <p><strong>学校：</strong> {{ education.school }}</p>
                                <p><strong>专业：</strong> {{ education.major }}</p>
                                <p><strong>学历/学位：</strong> {{ education.degree }}</p>
                            </div>
                            <div class="col-md-6">
                                <p><strong>入学时间：</strong> {{ education.start_date }}</p>
                                <p><strong>毕业时间：</strong> {{ education.end_date }}</p>
                                <p><strong>GPA/平均分：</strong> {{ education.gpa|default:'-' }}</p>
                            </div>
                        </div>
                        <p><strong>在校表现：</strong></p>
                        <p>{{ education.description|default:'-' }}</p>
                    </div>
                {% else %}
                    <p class="text-muted">暂无教育经历信息</p>
                {% endif %}
            </div>

            <!-- 工作经验部分 -->
            <div class="section">
                <h3 class="section-title"><i class="fas fa-briefcase"></i> 工作经验</h3>
                {% if work %}
                    <div class="work-item">
                        <div class="row">
                            <div class="col-md-6">
                                <p><strong>公司名称：</strong> {{ work.company_name }}</p>
                                <p><strong>职位：</strong> {{ work.position }}</p>
                                <p><strong>部门：</strong> {{ work.department }}</p>
                            </div>
                            <div class="col-md-6">
                                <p><strong>开始时间：</strong> {{ work.start_date }}</p>
                                <p><strong>结束时间：</strong> {{ work.end_date }}</p>
                            </div>
                        </div>
                        <p><strong>工作职责：</strong></p>
                        <p>{{ work.responsibilities|default:'-' }}</p>
                    </div>
                {% else %}
                    <p class="text-muted">暂无工作经验信息</p>
                {% endif %}
            </div>

            <!-- 专业技能部分 -->
            <div class="section">
                <h3 class="section-title"><i class="fas fa-cogs"></i> 专业技能</h3>
                {% if skill %}
                    <div class="skill-item">
                        <p><strong>技能名称：</strong> {{ skill.name }}</p>
                        <p><strong>熟练程度：</strong> {{ skill.level }}</p>
                        <p><strong>技能描述：</strong></p>
                        <p>{{ skill.description|default:'-' }}</p>
                    </div>
                {% else %}
                    <p class="text-muted">暂无专业技能信息</p>
                {% endif %}
            </div>

            <!-- 获奖情况部分 -->
            <div class="section">
                <h3 class="section-title"><i class="fas fa-trophy"></i> 获奖情况</h3>
                {% if award %}
                    <div class="award-item">
                        <div class="row">
                            <div class="col-md-6">
                                <p><strong>奖项名称：</strong> {{ award.award_name }}</p>
                                <p><strong>获奖级别：</strong> {{ award.award_level }}</p>
                            </div>
                            <div class="col-md-6">
                                <p><strong>获奖时间：</strong> {{ award.award_date }}</p>
                                <p><strong>颁发机构：</strong> {{ award.award_organization }}</p>
                            </div>
                        </div>
                        <p><strong>奖项描述：</strong></p>
                        <p>{{ award.award_description|default:'-' }}</p>
                    </div>
                {% else %}
                    <p class="text-muted">暂无获奖情况信息</p>
                {% endif %}
            </div>
        </div>

        <div class="action-buttons">
            <a href="{% url 'job:export_resume' %}" class="btn btn-success" id="export-resume">
                <i class="fas fa-download"></i> 导出简历
            </a>
        </div>
    </div>


    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script src="{% static 'js/resume_preview.js' %}"></script>
{% endblock %}